﻿@model MVCDemo.Models.Company

@{
    ViewBag.Title = "CheckBoxList";
}

<div style="font-family: Arial">
    <h2>RadioButtonList</h2>
    @using (Html.BeginForm())
    {
        foreach (var department in Model.Departments)
        {
            @Html.RadioButtonFor(m => m.SelectedDepartment,department.deptId
            ,(department.IsSelected.HasValue&&department.IsSelected.Value)? new {@checked="checked"}:null
            ) @department.deptName
        }
        <br />
        <br />
        <input type="submit" value="submit" />
    }
</div>
